<template>
  <el-pagination
    :page-sizes="[2, 4, 8, 10]"
    :page-size="showSize"
    layout="total, sizes, prev, pager, next, jumper"
    :total="total"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
  />
</template>

<script>
export default {
  props: {
    total: {
      type: [String, Number],
      required: true
    }
  },
  data() {
    return {
      showSize: 2
    }
  },

  created() {

  },

  methods: {
    handleSizeChange(val) {
      this.showSize = val
      this.$emit('change-pagesize', val)
    },
    handleCurrentChange(val) {
      this.$emit('change-page', val)
    }
  }
}
</script>

<style scoped lang='less'>

</style>
